package com.summer.web;

import com.summer.web.jms.Msg;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableTransactionManagement
@SpringBootApplication(scanBasePackages = "com.summer")
@MapperScan(value="com.summer.dao")
public class BootApplication implements CommandLineRunner{

    @Autowired
	private JmsTemplate jmsTemplate;

    public static void main(String[] args) throws Exception {
        SpringApplication app = new SpringApplication();
        app.setBannerMode(Banner.Mode.OFF);
        app.run(BootApplication.class, args);
    }

    @Override
    public void run(String... strings) throws Exception {

        jmsTemplate.send("my-destination",new Msg());


    }
}
